package logrus.beanmock.invoker;

import java.util.HashMap;
import java.util.Map;


public class CounterAccessorImpl implements CounterAccessor {
    
    private Map<MethodInvocationInfo, Counter> counters = new HashMap<MethodInvocationInfo, Counter>();

    public Counter getCounter(MethodInvocationInfo info) {
        Counter counter = counters.get(info);
        if (counter == null) {
            counter = new Counter(info.getMinCount(), info.getMaxCount());
            counters.put(info, counter);
        }
        return counter;
    }

}
